<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

	<head>
		<meta  http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>查询病人</title>
		<!-- 新 Bootstrap 核心 CSS 文件 -->
		<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
		<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
		<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
		<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
		<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
	</head>

	<body>
		<div class="jumbotron text-center" style="margin-bottom:0;color:#158bb8">
			<h1>武汉方舱医院病人管理系统</h1>
		</div>

		<nav class="navbar navbar-inverse">
			<div class="container-fluid">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
					<a class="navbar-brand" href="#">JavaEE</a>
				</div>
				<div class="collapse navbar-collapse" id="myNavbar">
					<ul class="nav navbar-nav">
						<li>
							<a href="<c:url value="/index.html"/>">主页</a>
						</li>
						<li>
							<a href="<c:url value="/patientlist.html"/>">列表</a>
						</li>
						<li>
							<a href="<c:url value="/newPatient.html"/>">新增病人</a>
						</li>
						<li class="active">
							<a href="#">查询修改病人</a>
						</li>
						<li>
							<a href="<c:url value="/wardList.html"/>">病房一览</a>
						</li>
					</ul>
				</div>
			</div>
		</nav>
		<h2>编号操作:</h2>
		<form class="form-horizontal" role="form" method="post" action="<c:url value="/queryByPno.html"/> ">
			<div class="form-group">
				<label for="pno" class="col-sm-2 control-label">Pno</label>
				<div class="col-sm-7">
					<input type="text" class="form-control" id="pno" name="pno" placeholder="请输入pno">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-default">根据编号查询修改</button>
				</div>
			</div>
		</form>
		<h2>根据姓名查询:</h2>
		<form class="form-horizontal" role="form" method="post" action="<c:url value="/queryByName.html"/> ">
			<div class="form-group">
				<label for="name" class="col-sm-2 control-label">Name</label>
				<div class="col-sm-7">
					<input type="text" class="form-control" id="name" name="name" placeholder="请输入Name">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-default">根据姓名查询</button>
				</div>
			</div>
		</form>
		<table class="table table-hover col-sm-10">
			<h2>Patient List</h2>
			<thead>
			<tr>
				<th>pno</th>
				<th>name</th>
				<th>sex</th>
				<th>age</th>
				<th>status</th>
				<th>wardId</th>
				<th>bedId</th>
				<th>familyPhone</th>
			</tr>
			</thead>
			<tbody>
			<c:forEach items="${patients}" var="patient">
			<tr>
				<td>${patient.pno}</td>
				<td>${patient.name}</td>
				<td>${patient.sex}</td>
				<td>${patient.age}</td>
				<td>${patient.status}</td>
				<td>${patient.wardId}</td>
				<td>${patient.bedId}</td>
				<td>${patient.familyPhone}</td>
			</tr>
			</c:forEach>
		</table>
	</body>

</html>